<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>课程直播</title>
</head>
<body>
 <div class="mainContainer">
        <video id="videoElement" controls autoplay width="1024"  muted="muted" height="576"></video>
    </div>
    <br>
    <div >
        <button onclick="flv_start()">开始</button>
        <button onclick="flv_pause()">暂停</button>
        <button onclick="flv_destroy()">停止</button>
    </div>
    
 <script src="/static/lib/flv/flv.min.js" type="text/javascript" ></script>
   <script>
        var flvjs = window.flvjs
        var videoElementzzz  = document.getElementById('videoElement');
        var flvPlayer;
        if (flvjs.isSupported()) {
             flvPlayer = flvjs.createPlayer({
                type: 'flv',
                isLive : true,
                url: 'http://47.92.196.10:8080/live/xz1.flv',
                //url: 'http://127.0.0.1:8080/live/rfBd56ti2SMtYvSgD5xAV0YU99zampta7Z7S575KLkIZ9PYk.flv',//改为自己服务的地址
            });
            flvPlayer.attachMediaElement(videoElementzzz );
            flvPlayer.load(); //加载
            flvPlayer.play();
        }
        function flv_start() {
        	flvPlayer.play();
        }
        function flv_pause() {
        	flvPlayer.pause();
        }
        function flv_destroy() {
        	flvPlayer.pause();
        	flvPlayer.unload();
        	flvPlayer.detachMediaElement();
        	flvPlayer.destroy();
        	flvPlayer = null;
        }
        flv_start();
        
        
        
        
        
    </script>
</body>
</html>